﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OnlineMovieTicket.Services.IServices;
using OnlineMovieTicket.Data.IRepository;
using OnlineMovieTicket.Data.Repository;

namespace OnlineMovieTicket.Services.Services
{
    public class MovieAssignmentService : IMovieAssignmentService
    {
        IMovieTimeTableRepository movieTimeTableRepo;

        public MovieAssignmentService()
        {
            movieTimeTableRepo = new MovieTimeTableRepository();
        }

        public bool CreateMovieAssignment(Model.MovieTimeTable movieTimeTable)
        {
            return movieTimeTableRepo.InsertMovieTimeTable(movieTimeTable);
        }

        public IList<Model.MovieTimeTable> GetMovieAssignment(int movieCode, int cinemaHallID, DateTime showingDate)
        {
            return movieTimeTableRepo.GetMovieTimeTable(movieCode, cinemaHallID, showingDate);
        }

        public bool DeleteMovieAssignment(int movieAssignmentID)
        {
            return movieTimeTableRepo.DeleteMovieTimeTable(movieAssignmentID);
        }
    }
}
